﻿using System;
using System.ComponentModel;
using Loki.Utils;
using Luna.Data.Crm;
using Luna.Model.Common;

namespace Luna.Model.Crm
{
    internal class EditableEntity : Entity, IEditableEntity, IGeoAddress
    {
        public EditableEntity()
        {
        }

        public EditableEntity(IEntityData data)
            : base(data)
        {
        }

        public EditableEntity(Entity clone)
            : base(clone)
        {
        }

        #region Manager

        private static PropertyChangedEventArgs argsManagerChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.Manager);

        private static PropertyChangingEventArgs argsManagerChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.Manager);

        public new string Manager
        {
            get
            {
                return Data.Manager;
            }

            set
            {
                if (value != Data.Manager)
                {
                    NotifyChanging(argsManagerChanging);
                    Data.Manager = value;
                    NotifyChangedAndDirty(argsManagerChanged);
                }
            }
        }

        #endregion Manager

        #region Surname

        private static PropertyChangedEventArgs argsSurnameChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.Surname);

        private static PropertyChangingEventArgs argsSurnameChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.Surname);

        public new string Surname
        {
            get
            {
                return Data.Surname;
            }

            set
            {
                if (value != Data.Surname)
                {
                    NotifyChanging(argsSurnameChanging);
                    Data.Surname = value;
                    NotifyChangedAndDirty(argsSurnameChanged);
                    NotifyChanged(argsFullNameChanged);
                }
            }
        }

        #endregion Surname

        private static PropertyChangedEventArgs argsFullNameChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.FullName);

        #region Name

        private static PropertyChangedEventArgs argsNameChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.Name);

        private static PropertyChangingEventArgs argsNameChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.Name);

        public new string Name
        {
            get
            {
                return Data.Name;
            }

            set
            {
                if (value != Data.Name)
                {
                    NotifyChanging(argsNameChanging);
                    Data.Name = value;
                    NotifyChangedAndDirty(argsNameChanged);
                    NotifyChanged(argsFullNameChanged);
                }
            }
        }

        #endregion Name

        #region Company

        private static PropertyChangedEventArgs argsCompanyChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.Company);

        private static PropertyChangingEventArgs argsCompanyChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.Company);

        public new string Company
        {
            get
            {
                return Data.Company;
            }

            set
            {
                if (value != Data.Company)
                {
                    NotifyChanging(argsCompanyChanging);
                    Data.Company = value;
                    NotifyChangedAndDirty(argsCompanyChanged);
                }
            }
        }

        #endregion Company

        #region Title

        private static PropertyChangedEventArgs argsTitleChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.Title);

        private static PropertyChangingEventArgs argsTitleChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.Title);

        public new string Title
        {
            get
            {
                return Data.Title;
            }

            set
            {
                if (value != Data.Title)
                {
                    NotifyChanging(argsTitleChanging);
                    Data.Title = value;
                    NotifyChangedAndDirty(argsTitleChanged);
                    NotifyChanged(argsFullNameChanged);
                }
            }
        }

        #endregion Title

        #region Phone

        private static PropertyChangedEventArgs argsPhoneChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.Phone);

        private static PropertyChangingEventArgs argsPhoneChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.Phone);

        public new string Phone
        {
            get
            {
                return Data.Phone;
            }

            set
            {
                if (value != Data.Phone)
                {
                    NotifyChanging(argsPhoneChanging);
                    Data.Phone = value;
                    NotifyChangedAndDirty(argsPhoneChanged);
                }
            }
        }

        #endregion Phone

        #region Mobile

        private static PropertyChangedEventArgs argsMobileChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.Mobile);

        private static PropertyChangingEventArgs argsMobileChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.Mobile);

        public new string Mobile
        {
            get
            {
                return Data.Mobile;
            }

            set
            {
                if (value != Data.Mobile)
                {
                    NotifyChanging(argsMobileChanging);
                    Data.Mobile = value;
                    NotifyChangedAndDirty(argsMobileChanged);
                }
            }
        }

        #endregion Mobile

        #region Source

        private static PropertyChangedEventArgs argsSourceChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.Source);

        private static PropertyChangingEventArgs argsSourceChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.Source);

        public new string Source
        {
            get
            {
                return Data.Source;
            }

            set
            {
                if (value != Data.Source)
                {
                    NotifyChanging(argsSourceChanging);
                    Data.Source = value;
                    NotifyChangedAndDirty(argsSourceChanged);
                }
            }
        }

        #endregion Source

        #region Url

        private static PropertyChangedEventArgs argsUrlChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.Url);

        private static PropertyChangingEventArgs argsUrlChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.Url);

        public new string Url
        {
            get
            {
                return Data.Url;
            }

            set
            {
                if (value != Data.Url)
                {
                    NotifyChanging(argsUrlChanging);
                    Data.Url = value;
                    NotifyChangedAndDirty(argsUrlChanged);
                }
            }
        }

        #endregion Url

        #region Mail

        private static PropertyChangedEventArgs argsMailChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.Mail);

        private static PropertyChangingEventArgs argsMailChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.Mail);

        public new string Mail
        {
            get
            {
                return Data.Mail;
            }

            set
            {
                if (value != Data.Mail)
                {
                    NotifyChanging(argsMailChanging);
                    Data.Mail = value;
                    NotifyChangedAndDirty(argsMailChanged);
                }
            }
        }

        #endregion Mail

        #region Fax

        private static PropertyChangedEventArgs argsFaxChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.Fax);

        private static PropertyChangingEventArgs argsFaxChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.Fax);

        public new string Fax
        {
            get
            {
                return Data.Fax;
            }

            set
            {
                if (value != Data.Fax)
                {
                    NotifyChanging(argsFaxChanging);
                    Data.Fax = value;
                    NotifyChangedAndDirty(argsFaxChanged);
                }
            }
        }

        #endregion Fax

        #region Status

        private static PropertyChangedEventArgs argsStatusChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.Status);

        private static PropertyChangingEventArgs argsStatusChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.Status);

        public new string Status
        {
            get
            {
                return Data.Status;
            }

            set
            {
                if (value != Data.Status)
                {
                    NotifyChanging(argsStatusChanging);
                    Data.Status = value;
                    NotifyChangedAndDirty(argsStatusChanged);
                }
            }
        }

        #endregion Status

        #region Skype

        private static PropertyChangedEventArgs argsSkypeChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.Skype);

        private static PropertyChangingEventArgs argsSkypeChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.Skype);

        public new string Skype
        {
            get
            {
                return Data.Skype;
            }

            set
            {
                if (value != Data.Skype)
                {
                    NotifyChanging(argsSkypeChanging);
                    Data.Skype = value;
                    NotifyChangedAndDirty(argsSkypeChanged);
                }
            }
        }

        #endregion Skype

        #region Twitter

        private static PropertyChangedEventArgs argsTwitterChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.Twitter);

        private static PropertyChangingEventArgs argsTwitterChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.Twitter);

        public new string Twitter
        {
            get
            {
                return Data.Twitter;
            }

            set
            {
                if (value != Data.Twitter)
                {
                    NotifyChanging(argsTwitterChanging);
                    Data.Twitter = value;
                    NotifyChangedAndDirty(argsTwitterChanged);
                }
            }
        }

        #endregion Twitter

        #region Sector

        private static PropertyChangedEventArgs argsSectorChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.Sector);

        private static PropertyChangingEventArgs argsSectorChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.Sector);

        public new string Sector
        {
            get
            {
                return Data.Sector;
            }

            set
            {
                if (value != Data.Sector)
                {
                    NotifyChanging(argsSectorChanging);
                    Data.Sector = value;
                    NotifyChangedAndDirty(argsSectorChanged);
                }
            }
        }

        #endregion Sector

        #region NoMail

        private static PropertyChangedEventArgs argsNoMailChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.NoMail);

        private static PropertyChangingEventArgs argsNoMailChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.NoMail);

        public new bool NoMail
        {
            get
            {
                return Data.NoMail;
            }

            set
            {
                if (value != Data.NoMail)
                {
                    NotifyChanging(argsNoMailChanging);
                    Data.NoMail = value;
                    NotifyChangedAndDirty(argsNoMailChanged);
                }
            }
        }

        #endregion NoMail

        #region Address

        private static PropertyChangedEventArgs argsAdressChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.Address);

        private static PropertyChangingEventArgs argsAdressChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.Address);

        public new string Address
        {
            get
            {
                return Data.Address;
            }

            set
            {
                if (value != Data.Address)
                {
                    NotifyChanging(argsAdressChanging);
                    Data.Address = value;
                    NotifyChangedAndDirty(argsAdressChanged);
                }
            }
        }

        #endregion Address

        #region ZipCode

        private static PropertyChangedEventArgs argsZipCodeChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.ZipCode);

        private static PropertyChangingEventArgs argsZipCodeChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.ZipCode);

        public new string ZipCode
        {
            get
            {
                return Data.ZipCode;
            }

            set
            {
                if (value != Data.ZipCode)
                {
                    NotifyChanging(argsZipCodeChanging);
                    Data.ZipCode = value;
                    NotifyChangedAndDirty(argsZipCodeChanged);
                }
            }
        }

        #endregion ZipCode

        #region City

        private static PropertyChangedEventArgs argsCityChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.City);

        private static PropertyChangingEventArgs argsCityChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.City);

        public new string City
        {
            get
            {
                return Data.City;
            }

            set
            {
                if (value != Data.City)
                {
                    NotifyChanging(argsCityChanging);
                    Data.City = value;
                    NotifyChangedAndDirty(argsCityChanged);
                }
            }
        }

        #endregion City

        #region Country

        private static PropertyChangedEventArgs argsCountryChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.Country);

        private static PropertyChangingEventArgs argsCountryChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.Country);

        public new string Country
        {
            get
            {
                return Data.Country;
            }

            set
            {
                if (value != Data.Country)
                {
                    NotifyChanging(argsCountryChanging);
                    Data.Country = value;
                    NotifyChangedAndDirty(argsCountryChanged);
                }
            }
        }

        #endregion Country

        #region Description

        private static PropertyChangedEventArgs argsDescriptionChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.Description);

        private static PropertyChangingEventArgs argsDescriptionChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.Description);

        public new string Description
        {
            get
            {
                return Data.Description;
            }

            set
            {
                if (value != Data.Description)
                {
                    NotifyChanging(argsDescriptionChanging);
                    Data.Description = value;
                    NotifyChangedAndDirty(argsDescriptionChanged);
                }
            }
        }

        #endregion Description

        #region LastUpdate

        private static PropertyChangedEventArgs argsLastUpdateChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.LastUpdate);

        private static PropertyChangingEventArgs argsLastUpdateChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.LastUpdate);

        public new DateTime LastUpdate
        {
            get
            {
                return Data.LastUpdate;
            }

            set
            {
                if (value != Data.LastUpdate)
                {
                    NotifyChanging(argsLastUpdateChanging);
                    Data.LastUpdate = value;
                    NotifyChangedAndDirty(argsLastUpdateChanged);
                }
            }
        }

        #endregion LastUpdate

        #region Google

        private static PropertyChangedEventArgs argsGoogleChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.Google);

        private static PropertyChangingEventArgs argsGoogleChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.Google);

        public new string Google
        {
            get
            {
                return Data.Google;
            }

            set
            {
                if (value != Data.Google)
                {
                    NotifyChanging(argsGoogleChanging);
                    Data.Google = value;
                    NotifyChangedAndDirty(argsGoogleChanged);
                }
            }
        }

        #endregion Google

        #region GoogleLastUpdate

        private static PropertyChangedEventArgs argsGoogleLastUpdateChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.GoogleLastUpdate);

        private static PropertyChangingEventArgs argsGoogleLastUpdateChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.GoogleLastUpdate);

        public new DateTime? GoogleLastUpdate
        {
            get
            {
                return Data.GoogleLastUpdate;
            }

            set
            {
                if (value != Data.GoogleLastUpdate)
                {
                    NotifyChanging(argsGoogleLastUpdateChanging);
                    Data.GoogleLastUpdate = value;
                    NotifyChangedAndDirty(argsGoogleLastUpdateChanged);
                }
            }
        }

        #endregion GoogleLastUpdate

        #region ZohoCRM

        private static PropertyChangedEventArgs argsZohoCRMChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.ZohoCRM);

        private static PropertyChangingEventArgs argsZohoCRMChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.ZohoCRM);

        public new int? ZohoCRM
        {
            get
            {
                return Data.ZohoCRM;
            }

            set
            {
                if (value != Data.ZohoCRM)
                {
                    NotifyChanging(argsZohoCRMChanging);
                    Data.ZohoCRM = value;
                    NotifyChangedAndDirty(argsZohoCRMChanged);
                }
            }
        }

        #endregion ZohoCRM

        #region ZohoCRMLastUpdate

        private static PropertyChangedEventArgs argsZohoCRMLastUpdateChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.ZohoCRMLastUpdate);

        private static PropertyChangingEventArgs argsZohoCRMLastUpdateChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.ZohoCRMLastUpdate);

        public new DateTime? ZohoCRMLastUpdate
        {
            get
            {
                return Data.ZohoCRMLastUpdate;
            }

            set
            {
                if (value != Data.ZohoCRMLastUpdate)
                {
                    NotifyChanging(argsZohoCRMLastUpdateChanging);
                    Data.ZohoCRMLastUpdate = value;
                    NotifyChangedAndDirty(argsZohoCRMLastUpdateChanged);
                }
            }
        }

        #endregion ZohoCRMLastUpdate

        #region From

        private static PropertyChangedEventArgs argsFromChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.From);

        private static PropertyChangingEventArgs argsFromChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.From);

        public new ProviderType From
        {
            get
            {
                return Data.From;
            }

            set
            {
                if (value != Data.From)
                {
                    NotifyChanging(argsFromChanging);
                    Data.From = value;
                    NotifyChangedAndDirty(argsFromChanged);
                }
            }
        }

        #endregion From

        #region Validated

        private static PropertyChangedEventArgs argsValidatedChanged = ObservableHelper.CreateChangedArgs<EditableEntity>(x => x.Validated);

        private static PropertyChangingEventArgs argsValidatedChanging = ObservableHelper.CreateChangingArgs<EditableEntity>(x => x.Validated);

        public new bool Validated
        {
            get
            {
                return Data.Validated;
            }

            set
            {
                if (value != Data.Validated)
                {
                    NotifyChanging(argsValidatedChanging);
                    Data.Validated = value;
                    NotifyChangedAndDirty(argsValidatedChanged);
                }
            }
        }

        #endregion Validated
    }
}